package service

import (
	"zimuzu_cvn_web_api/pkg/drive/redis"
	. "zimuzu_cvn_web_api/pkg/e"
	"zimuzu_cvn_web_api/service/cache"
)

func GetSecretKey(uid int64, author string) string {
	var str string
	pointOneKey := cache.GetPointOneKey(uid, author)
	k1, err := redis.Get(pointOneKey)
	if err != nil || k1 == "" {
		return ""
	}
	pointTwoKey := cache.GetPointTwoKey(uid, author)
	k2, err := redis.Get(pointTwoKey)
	if err != nil || k2 == "" {
		return ""
	}
	l := Min(len(k1), len(k2))
	for i := 0; i < l; i++ {
		if i % 2 == 0 {
			str += string(k1[i])
		} else {
			str += string(k2[i])
		}
	}
	return str
}

